#include <bits/stdc++.h>
using namespace std;
int main() {
   int n;
   cin >> n;
   
   vector<string > mp(n+1);
   for(int i=1;i<=n;i++){
    string s;
    cin >> s;
    mp[1]=s;

   }
   int x;string y;
   cin>> x>> y;[
   cout<< (  mp[x]==y ? "Yes":"No" ); 


  return 0;
}